home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / private / _newline.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.1 KB  |  51 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3.  
  4. #ifdef PDCDEBUG
  5. char *rcsid__newline = "$Header: C:\CURSES\private\RCS\_newline.c 2.1 1993/06/18 20:23:30 MH Rel MH $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_newline()    - Advances 1 newline from supplied line number.
  14.  
  15.   PDCurses Description:
  16.      This is a private PDCurses routine.
  17.  
  18.      Does line advance and returns the new cursor line.  If error,
  19.      return -1.
  20.  
  21.   PDCurses Return Value:
  22.      This function returns OK on success and ERR on error.
  23.  
  24.   PDCurses Errors:
  25.      No errors are defined for this function.
  26.  
  27.   Portability:
  28.      PDCurses    int PDC_newline( WINDOW* win, int lin );
  29.  
  30. **man-end**********************************************************************/
  31.  
  32. int    PDC_newline(WINDOW *win, int lin)
  33. {
  34. #ifdef PDCDEBUG
  35.     if (trace_on) PDC_debug("PDC_newline() - called: line %d\n",lin);
  36. #endif
  37.  
  38.     if (win == (WINDOW *)NULL)
  39.         return( -1 );
  40.  
  41.     if (++lin > win->_bmarg)
  42.     {
  43.         lin--;
  44.         if (win->_scroll)
  45.             scroll(win);
  46.         else
  47.             return( -1 );
  48.     }
  49.     return( lin );
  50. }
  51.